package com.sw.code4j.vo;

import com.sw.code4j.common.ColumnTypeUtils;
import com.sw.code4j.common.StringUtils;
import com.gwssi.fusion.datamodel.bo.TDmColumnBO;
import com.gwssi.optimus.mongo.util.TransColumnNameToCamel;
import lombok.Data;

/**
 * @author: 张上亚 2021/11/30 11:28
 * @desc: 列信息vo类
 */
@Data
public class ColumnVO extends TDmColumnBO {

    public ColumnVO(String columnName, String columnComment, String columnType, String isCase) {
        setColumnName(columnName);
        setColumnComment(columnComment);
        setColumnType(columnType);
        setIsCase(isCase);
        this.camelColumnName = TransColumnNameToCamel.underlineToCamel(columnName);
        this.upperCamelColumnName = StringUtils.upperFirst(camelColumnName);
        this.javaColumnType = ColumnTypeUtils.getJavaType(columnType);
    }

    /**
     * 驼峰式列名
     */
    private String camelColumnName;
    /**
     * 首字母大写的驼峰列名
     */
    private String upperCamelColumnName;
    /**
     * java中的列类型
     */
    private String javaColumnType;

}
